home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MATH.SWG / 0058_Roots.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  1KB  |  46 lines

  1. {
  2. > I am trying to write a program that will find the cube root of the
  3. > numbers 1 to 50.
  4.  
  5. OK. You will have to use the EXP and LN functions as follows (full explanation
  6. of mathematics involved, to give you the general background)
  7.  
  8.        X=log Y means Y = a^X    (1)
  9.             a
  10.  
  11.        and  log X = LN(X) ; e^X = EXP(X) and EXP(LN(X))=X   (2)
  12.                e
  13.  
  14. Your problem is e.g.  10 = a^3 and you want to find a solution for a
  15.  
  16.  now from (1)
  17.  
  18.              10 = a^3 so 3=log 10
  19.                               a
  20.                                         log k
  21. We lose the a by using the rule log k = --------  (the base is not important)
  22.                                    a    log a
  23.  
  24.          log 10
  25.  so  3 = ------
  26.          log a
  27.  
  28.                                 LN(10)
  29.  or using base e, in Pascal 3 = ------
  30.                                 LN(a)
  31.  
  32.                                 LN(10)
  33.                         LN(a) = ------ = 0.76752836433
  34.                                   3
  35.  
  36.  to find a we have to raise e to this power and EXP(....)= 2.15443469003
  37.  
  38.  which is the 3rd root of 10
  39.  
  40. This works for all root calculations so
  41.  
  42.  
  43.  ROOT(X,Y):=EXP(LN(Y)/X)
  44.  
  45. }
  46.